import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function page(limit, offset, name, type) {
  return request({
    url: '/system/protectiveWear/getPage',
    method: 'post',
    data: qs.stringify({
      limit,
      offset,
      name,
      type
    })
  })
}

/**
 * 获取详情
 * @param id
 */
export function getInfo(id) {
  return request({
    url: '/system/protectiveWear/getInfo',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 删除
 * @param id
 */
export function delInfo(id) {
  return request({
    url: '/system/protectiveWear/del',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 新增或编辑
 * @param id
 * @param name
 * @param menuKey
 * @param pId
 * @param type
 */
export function addOrEdit(id, name, type, number, factoryNumber, norms, moldType) {
  return request({
    url: '/system/protectiveWear/addOrEdit',
    method: 'post',
    data: qs.stringify({
      id, name, type, number, factoryNumber, norms, moldType
    })
  })
}

/**
 * 列表
 */
export function getList(type, flat, moldType, name) {
  return request({
    url: '/system/protectiveWear/getList',
    method: 'post',
    data: qs.stringify({type, flat, moldType, name})
  })
}

